<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.jxLC.Action.*"%>
<%@ page language="java" import="com.jxLC.Model.*" %>
<%@ page language="java" import="com.jxLC.Service.*" %>
<%@include file="/checkuLoginSession.jsp" %>
<%@ page language="java" import="com.jxLC.util.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
FilesService filesService=new FilesService();
FilecontentService f=new FilecontentService();
UserService userService=new UserService();
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>:::江西低碳-企业用户平台:::</title>
	<link href="<%= request.getContextPath()%>/mycss/my.css"  rel="stylesheet" type="text/css" />
	<link href="<%= request.getContextPath()%>/mycss/details.css"  rel="stylesheet" type="text/css" />
	<link href="<%= request.getContextPath()%>/mycss/default.css"  rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="<%= request.getContextPath()%>/Kindeditor/themes/default/default.css" />
	<link rel="stylesheet" href="<%= request.getContextPath()%>/Kindeditor/plugins/code/prettify.css" />
	<script charset="utf-8" src="/MyProject1/Kindeditor/kindeditor.js"></script>
	<script charset="utf-8" src="/MyProject1/Kindeditor/lang/zh_CN.js"></script>
	<script charset="utf-8" src="/MyProject1/Kindeditor/plugins/code/prettify.js"></script>
	<script type="text/javascript" src="/MyProject1/myjs/jquery.js"></script>
	<script type="text/javascript" src="/MyProject1/myjs/glDatePicker.js"></script>
	<script type="text/javascript" src="/MyProject1/myjs/my.js"></script>
	<style type="text/css">
	 #m{ height:500px;padding-top:20px;background-color:white}
	 #mc1{font-size:18px;padding-left:450px;font-weight:bold}
	 #mc2{padding-left:20px;font-size:14px;color:red;font-family:"新宋体";margin-top:20px;}
	 table,td,th{border:1px solid #AAAAAA;border-collapse:collapse;}
	 th{background:#DDDDFF; height:50px;}
	 table{ font-size:13px;font-family:"宋";}
	 table caption {font-weight:bold;font-size:16px;color:black;}
	.tcolumn{background:#DDDDFF; font-size:14px;font-weight: bold;height:20px;width:150px }
	.tcolumn1{background:#DDDDFF; font-size:14px;font-weight: bold;height:60px;}
	.tcolumn2{width:400px;}
    </style>
    <script type="text/javascript">
     function checkForm(myform){
      if(myform.CFC_topic.value==""){
       alert('文件主题不能为空');
       myform.CFC_topic.focus();
       return false;
      }
      if(myform.CFC_time.value==""){
       alert('发布时间不能为空');
       myform.CFC_time.focus();
       return false;
      }
         return true;
    }
        $(function()
            {
		      $("#date1").glDatePicker();
            });
       KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="CFC_text"]', {
				cssPath : '/MyProject1/Kindeditor/plugins/code/prettify.css',
				uploadJson : 'ImgUploadAction!uploadImage',
				fileManagerJson : '/MyProject1/Kindeditor/jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
				}
			});
			prettyPrint();
		});

       $(function(){
   		$(".add").click(function (){
   			 $(".srow").append($(this).parent("p").clone(true));
   		});
   		
   		$(".mul").click(function (){
   		if(confirm("确认删除？")) {
   			var si = $(".myp").size();
   			if(si > 1){
   				$(this).parent().remove();
   			}else {
   				alert("最后一条了哦~");
   			}
   		}		 
   		return false;
   	});

   		$(".delAnnex").click(function(){
   			$("#ann").remove();
   			});
   	});
	</script>
  </head>
  
 <body style="background-color:#EBFCF3">
    <s:include value="/admin/header.jsp"></s:include>
	<div id="m" >
          <div id="mc1">==查看编辑==</div>
          <div id="mc2">(*请您仔细阅读管理员反馈意见栏后再对您提交的文件进行相应的修改，本页面内容修改后可直接提交*)</div>
          <div id="mc3">
           <form action="updatefile" method="post" name="form1" onsubmit="return checkForm(this);">
            <table align="center"  width="950"  >
             <tr>
                <th style="width:350px"></th>
                <th style="width:400px">当前内容信息</th>
                <th>修改编辑</th>
             </tr>
              <tr>
               <%
		             Filecontent fcontent=(Filecontent)request.getAttribute("info");
		             Files files=filesService.getCtopic(fcontent.getCFile_id());
		             User user=userService.search(fcontent.getCNum());
			   %>
			    
                 <td class="tcolumn" align="center" >所属类别</td>
                 <td class="tcolumn2" align="center">
                 <font style="font-size:14px;"><%=files.getCFile_topic() %></font>
                 </td>
                 <td align="center">
                  <select name="CFile_id" style="width:230px;">
                 <%
                 List<Files> fs=filesService.getfile();
                 for(Files fc : fs){
                 %>
                  <option value="<%=fc.getCFile_id() %>"><%=fc.getCFile_topic() %></option>
                  <%
                  }
                  %>
                  </select></td>
              </tr>
              <tr>
                 <td class="tcolumn" align="center" >项目名称</td>
                 <td class="tcolumn2" align="center">
                  <font style="font-size:14px;"><%=fcontent.getCFC_topic() %></font>
                 </td>
                 <td align="center">
                   <input type="text" style="width:230px; height:30px;padding:6px;" name="CFC_topic" value="<%=fcontent.getCFC_topic() %>" onmouseover="this.focus()" onfocus="this.select()"/>
                   <input type="hidden" name="CFC_if"   value="<%=fcontent.getCFC_if()%>">
                   <input type="hidden" name="CFC_view" value="<%=fcontent.getCFC_view()%>" >
                   <input type="hidden" name="CFC_id" value="<%=fcontent.getCFC_id()%>" >
                 </td>
              </tr>
              <tr>
                  <td class="tcolumn" align="center" >作者编号</td>
                  <td class="tcolumn2" align="center">
                    <font style="font-size:14px;"><%=user.getCnum() %></font>
                  </td>
                 <td align="center">
                    <input type="text" style="width:230px; height:30px; padding:6px;" readonly="readonly" value="<%=user.getCId() %>" onmouseover="this.focus()" onfocus="this.select()"/>
                 </td>
             </tr>
             <tr>
                  <td class="tcolumn" align="center" >上传日期</td>
                  <td class="tcolumn2" align="center">
                  <font style="font-size:14px;"><%=fcontent.getCFC_time() %></font>
                  </td>
                  <td align="center">
                     <input type="text" style="width:230px; height:30px; padding:6px;" class="gldp" id="date1" name="CFC_time" value="<%=fcontent.getCFC_time()%>" />
                  </td>
             </tr>
             
             <tr>
                  <td class="tcolumn" align="center" >国家/地区</td>
                  <td class="tcolumn2" align="center">
                  <font style="font-size:14px;"><%=fcontent.getCFC_place() %></font>
                  </td>
                  <td align="center">
                     <input type="text" style="width:230px; height:30px; padding:6px;" class="gldp" id="date1" name="CFC_place" value="<%=fcontent.getCFC_place()%>" />
                  </td>
             </tr>
             
             <tr>
                  <td class="tcolumn" align="center" >项目分类</td>
                  <td class="tcolumn2" align="center">
                  <font style="font-size:14px;"><%=fcontent.getCFC_type()%></font>
                  </td>
                  <td align="center">
                     <input type="text" style="width:230px; height:30px; padding:6px;" class="gldp" id="date1" name="CFC_type" value="<%=fcontent.getCFC_type()%>" />
                  </td>
             </tr>
             <tr>
                  <td class="tcolumn" align="center" >合作方式</td>
                  <td class="tcolumn2" align="center">
                  <font style="font-size:14px;"><%=fcontent.getCFC_cooperation() %></font>
                  </td>
                  <td align="center">
                     <input type="text" style="width:230px; height:30px; padding:6px;" class="gldp" id="date1" name="CFC_cooperation" value="<%=fcontent.getCFC_cooperation()%>" />
                  </td>
             </tr>
             
              <tr >
				<td class="tcolumn" align="center">附件上传：</td>
				<td>
				<%
		                 	if(fcontent.getAnnex() != null && fcontent.getAnnex().length() > 0){
		                 		DealAnnex dann= new DealAnnex();
		                 		List<Annex> list = dann.getAnnex(fcontent.getAnnex());
		                 		for(int i=0;i<list.size();i++ ){
		                 			Annex ann = list.get(i);
		                 			%>
		                 			<div id="ann"><a href="<%=ann.getNewFile() %>"><%=ann.getOldFileName() %></a>
		                 			<input type="hidden" name="old_annex_name" value="<%=ann.getNewFile() %>">
		                 			<input type="hidden" name="new_annex_name" value="<%=ann.getOldFileName() %>">
		                 			&nbsp;&nbsp;&nbsp;&nbsp;
		                 			<span class="delAnnex">删除</span>
		                 			</div>
		                 			<%
		                 		}
		                 	}
					  		%>
					<s:if test="annexlist != null">
						<s:iterator value="annexlist" id="annexval">
						<p class="myp picFrame">
							<a href="#" class="mul" title="${annexval.link }  ${annexval.def1 }  点击删除" >
								<img class="annexPicSrc" src="${annexval.anneroute }" width="126" height="90"  />
							</a>
							<input type="hidden"  value="${annexval.pkArticleAnnex }" name="pkArticleAnnex"/>
							<input type="hidden" name="annexlink"  size="40" value="${annexval.link }" />
							<input type="hidden"  name="def1" size="30" value="${annexval.def1 }" />
						</p>
						</s:iterator>
					</s:if>
					<p style="float:left;width:100%;">
						<span class="red" id="ann1" style="display:none">图片为584x400px最佳</span>
					</p>
					<br/>
					<p class="myp">
						<input type="file" name="annex" value="" ;"/>&nbsp;&nbsp;
						<a  class="add">增行</a>&nbsp;&nbsp;<a  class="mul">删行</a><br/><br/>
					</p>
					
					<p class="srow"></p>
				</td>
			</tr>
             
             <%
                if(fcontent.getCFC_if().equals("未通过")){
                	%>
                	<tr>
                  <td class="tcolumn" align="center" style="height:80px;" >管理员反馈</td>
                  <td  align="center"  colspan="2" >
                    <font style="font-family:楷体;font-size:18px;color:red">【<%=fcontent.getCFC_view() %>】</font>
                  </td>
                </tr>
                	<%
                	}
             %>
             
             <tr>
                  <td class="tcolumn" align="center">文件内容</td>
                  <td  style="height:300px;"  colspan="2" >
		            <textarea id="content1" name="CFC_text" style="width:850;height:290px;visibility:hidden;"><%=fcontent.getCFC_text()%></textarea>
                  </td>
             </tr>
      <tr>
       <td colspan="3" align="center" class="tcolumn1">
        <input type="submit"  value="提交修改记录" onclick="return confirm('确定提交吗')"; style="padding:5px;">
       </td>
       </tr>
  </table  >
  </form>
          </div>
       </div>
	<s:include value="/admin/tail.jsp"></s:include>
</body>
</html>
